package server

import (
	"context"

	"go-weixin/app/usercenter/rpc/internal/logic"
	"go-weixin/app/usercenter/rpc/internal/svc"
	"go-weixin/app/usercenter/rpc/pb/proto/usercenter"
)

type TableServer struct {
	svcCtx *svc.ServiceContext
	usercenter.UnimplementedTableServer
}

func NewTableServer(svcCtx *svc.ServiceContext) *TableServer {
	return &TableServer{
		svcCtx: svcCtx,
	}
}
func (s *TableServer) TableAdd(ctx context.Context, in *usercenter.TableAddReq) (*usercenter.TableAddResp, error) {
	l := logic.NewTableLogic(ctx, s.svcCtx)
	return l.TableAdd(in)
}

func (s *TableServer) TableList(ctx context.Context, in *usercenter.TableListReq) (*usercenter.TableListResp, error) {
	l := logic.NewTableLogic(ctx, s.svcCtx)
	return l.TableList(in)
}

func (s *TableServer) TableUpdate(ctx context.Context, in *usercenter.TableUpdateReq) (*usercenter.TableUpdateResp, error) {
	l := logic.NewTableLogic(ctx, s.svcCtx)
	return l.TableUpdate(in)
}
